/**
 * 用户信息
 * 可在需要的页面使用this.$store.state.user.userInfo获取
 */
export default {
	state: {
		hasLogin:true,        //用户是否登录
		userInfo:{	//用户数据
			userid:"",
			openid:"",
			username:"",
			turename:"",
			tel:"",
			sex:"",
			imagepath:"",
			onlinestate:"",
			userstate:"",
			befocus:"",
			longitude:"",
			latitude:""
		}				
	},
	 //mutations定义同步操作的方法
	mutations: {
		setUserInfo(state,userInfo){
			state.userInfo = userInfo;
		},
		updateLocation(state,params){
			state.userInfo.latitude = params.latitude;
			state.userInfo.longitude = params.longitude;
		}
	},
	actions: {
		changeUserInfo({commit},param){
			commit('setUserInfo',param);
		}
	},
	getters:{
		user(state){
		    return state.userInfo;
		}
	}
	
}